import HTTP from '@/http/http'
const centerApi = import.meta.env.VITE_BASE_URL

class Api extends HTTP {
  // 预警种类灾害列表
  getTypeList(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/warning/getTypeList`,
      params
    })
  }
  // 各灾害级别预警数量汇总
  getWarningLevelNumStatistics(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/warning/getWarningLevelNumStatistics`,
      params
    })
  }
  // 预警种类灾害列表
  getWarningInfoList(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/warning/getWarningInfoList`,
      params
    })
  }
  // 轮询查询当天最新预警信息列表
  getTodayList(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/warning/getTodayList`,
      params
    })
  }
  // 根据日期范围导出24小时预警产品文档
  exportWarningPDF(params?: any) {
    return this.request({
      method: 'get',
      responseType: 'arraybuffer',
      url: `${centerApi}/warning/exportWarningPDF`,
      params
    })
  }
  // 查询市级信息
  getCityList(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/area/getCityList`,
      params
    })
  }
  // 查询县区级信息
  getCountyList(params?: any) {
    return this.request({
      method: 'get',
      url: `${centerApi}/area/getCountyList`,
      params
    })
  }
}
export default new Api()
